from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor

def son(para):
    for i in range(500):
        print(para,i)

if __name__ == '__main__':
    # th ThreadPoolExecutor(66) as tpool表示创建线程池，
    # 然后submit(func, args)表示将任务函数func（son）交给线程池，
    # args为任务函数的参数。运行结果（部分截取）如下：
    with ThreadPoolExecutor(4) as tpool:
        for i in range(10000):
            tpool.submit(son,para = f'线程{i}')

    print("线程池任务执行完毕")
